<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout" layout:decorate="body/main">
<head>
    <meta charset="UTF-8">
    <title>客户关系管理系统</title>
</head>
<body>
<div class="right_col" role="main" layout:fragment="content">
    <div class="">
        <div class="clearfix"></div>
        <div class="row">
            <div class="col-md-12">
                <div class="x_panel">
                    <div class="x_title">
                        <h2>
                            客户流失管理 <i class="fa fa-user"></i><small th:text="${session.loginUser.usrName }">用户名</small>
                        </h2>
                        <div class="clearfix"></div>
                    </div>
                    <div class="x_content">
                        <form method="post" action="/user/list" th:action="@{/api/lost/findLost}">
                            <input type="hidden" name="index" value="1" />
                            <ul>
                                <li>
                                    <div class="form-group">
                                        <label class="control-label col-md-4 col-sm-4 col-xs-12">客户名称</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input name="lstCustName" type="text" class="form-control col-md-7 col-xs-12" th:value="${lstCustName}">
                                        </div>
                                    </div>
                                </li>
                                <li>
                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">客户经理</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input name="lstCustManagerName" type="text" class="form-control col-md-7 col-xs-12" th:value="${lstCustManagerName}">
                                        </div>
                                    </div>
                                </li>
                                <li>
                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">状态</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <select name="status" class="form-control" id="lstStatus">
                                                <option value="">--全部--</option>
                                                <option value="暂缓流失" th:if="${status eq '暂缓流失'}" selected>暂缓流失</option>
                                                <option value="暂缓流失" th:if="${status != '暂缓流失'}">暂缓流失</option>
                                                <option value="确认流失" th:if="${status eq '确认流失'}" selected>确认流失</option>
                                                <option value="确认流失" th:if="${status != '确认流失'}">确认流失</option>
                                                <option value="流失预警" th:if="${status eq '流失预警'}" selected>流失预警</option>
                                                <option value="流失预警" th:if="${status != '流失预警'}">流失预警</option>
                                            </select>
                                        </div>
                                    </div>
                                </li>
                                <li><button type="submit" class="btn btn-primary"> 查 &nbsp;&nbsp;&nbsp;&nbsp;询 </button></li>
                            </ul>
                        </form>
                    </div>
                </div>
            </div>
            <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                    <div class="x_content">
                        <p class="text-muted font-13 m-b-30"></p>
                        <div id="datatable-responsive_wrapper"
                             class="dataTables_wrapper form-inline dt-bootstrap no-footer">
                            <div class="row">
                                <div class="col-sm-12">
                                    <table id="datatable-responsive" class="table table-striped table-bordered dt-responsive nowrap dataTable no-footer dtr-inline collapsed"
                                           cellspacing="0" width="100%" role="grid" aria-describedby="datatable-responsive_info" style="width: 100%;">
                                        <thead>
                                        <tr role="row">
                                            <th class="sorting_asc" tabindex="0"
                                                aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                                aria-label="First name: activate to sort column descending"
                                                aria-sort="ascending">编号</th>
                                            <th class="sorting" tabindex="0"
                                                aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                                aria-label="Last name: activate to sort column ascending">
                                                客户名称</th>
                                            <th class="sorting" tabindex="0"
                                                aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                                aria-label="Last name: activate to sort column ascending">
                                                客户经理</th>
                                            <th class="sorting" tabindex="0"
                                                aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                                aria-label="Last name: activate to sort column ascending">
                                                上次下单时间</th>
                                            <th class="sorting" tabindex="0"
                                                aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                                aria-label="Last name: activate to sort column ascending">
                                                确认流失时间</th>
                                            <th class="sorting" tabindex="0"
                                                aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                                aria-label="Last name: activate to sort column ascending">
                                                状态</th>
                                            <th class="sorting" tabindex="0"
                                                aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                                aria-label="Last name: activate to sort column ascending">
                                                操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr role="row" class="odd" th:each="lost,status : ${lostPage.getRecords()}">
                                            <td tabindex="0" class="sorting_1" th:text="${lost.lstId}"></td>
                                            <td th:text="${lost.lstCustName}"></td>
                                            <td th:text="${lost.lstCustManagerName}"></td>
                                            <td th:text="${#dates.format(lost.lstLastOrderDate,'yyyy-MM-dd HH:mm:ss')}"></td>
                                            <td th:text="${#dates.format(lost.lstLostDate,'yyyy-MM-dd HH:mm:ss')}"></td>
                                            <td th:text="${lost.lstStatus}"></td>
                                            <td>
                                                <div class="btn-group">
                                                    <button type="button" class="btn btn-danger">点击操作</button>
                                                    <button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
                                                        <span class="caret"></span>
                                                        <span class="sr-only">Toggle Dropdown</span>
                                                    </button>
                                                    <ul class="dropdown-menu" role="menu">
                                                        <li th:if="${lost.lstStatus eq '流失预警'}">
                                                            <a class="saleSwichOpen" saleSwitch="open" data-toggle="tooltip" data-placement="top" title=""
                                                               th:href="@{/api/lost/todelay(lstId=${lost.lstId})}">暂缓流失</a>
                                                        </li>
                                                        <li th:if="${lost.lstStatus eq '暂缓流失'}">
                                                            <a class="saleSwichOpen" saleSwitch="open" data-toggle="tooltip" data-placement="top" title=""
                                                               th:href="@{/api/lost/todelay(lstId=${lost.lstId})}">暂缓流失</a>
                                                            <a class="saleSwichOpen" saleSwitch="open" data-toggle="tooltip" data-placement="top" title=""
                                                               th:href="@{/api/lost/todelayok(lstId=${lost.lstId})}">确认流失</a>
                                                        </li>
                                                    </ul>
                                                </div>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-5">
                                    <div class="dataTables_info" id="datatable-responsive_info"
                                         role="status" aria-live="polite">共<span th:text="${lostPage.getTotal()}"></span>条记录
                                        <span th:text="${lostPage.getCurrent()}"></span>/<span th:text="${lostPage.getPages()}"></span>页</div>
                                </div>

                                <div class="col-sm-7">
                                    <div class="dataTables_paginate paging_simple_numbers"
                                         id="datatable-responsive_paginate">
                                        <ul class="pagination">
                                            <li class="paginate_button previous" th:if="${lostPage.getCurrent() gt 1}"><a
                                                    href="javascript:page_nav(document.forms[0],1);"
                                                    aria-controls="datatable-responsive" data-dt-idx="0"
                                                    tabindex="0">首页</a>
                                            </li>
                                            <li class="paginate_button " th:if="${lostPage.getCurrent() gt 1}"><a
                                                    href="#"th:onclick="'javascript:page_nav(document.forms[0],'+${lostPage.getCurrent() - 1}+');'"
                                                    aria-controls="datatable-responsive" data-dt-idx="1"
                                                    tabindex="0">上一页</a>
                                            </li>
                                            <li class="paginate_button " th:if="${lostPage.getCurrent() lt lostPage.getPages()}"><a
                                                    href="#"th:onclick="'javascript:page_nav(document.forms[0],'+${lostPage.getCurrent() + 1}+');'"
                                                    aria-controls="datatable-responsive" data-dt-idx="1"
                                                    tabindex="0">下一页</a>
                                            </li>
                                            <li class="paginate_button next" th:if="${lostPage.getCurrent() lt lostPage.getPages()}"><a
                                                    href="#"th:onclick="'javascript:page_nav(document.forms[0],'+${lostPage.getPages()}+');'";
                                                    aria-controls="datatable-responsive" data-dt-idx="7"
                                                    tabindex="0">最后一页</a>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script layout:fragment="js" th:inline="javascript">
</script>
</html>